package com.frxuexi.video.adapter

import android.view.View
import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.lib_base.entity.VideoBeanItem
import com.frxuexi.video.R
import com.frxuexi.video.databinding.ItemVideoBinding

class VideoAdapter:BaseQuickAdapter<VideoBeanItem,BaseViewHolder>(R.layout.item_video) {
    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemVideoBinding>(viewHolder.itemView)
    }
    override fun convert(helper: BaseViewHolder, item: VideoBeanItem) {
        val binding = DataBindingUtil.getBinding<ItemVideoBinding>(helper.itemView)!!
        binding.gsy.apply {
            setUp(item.videopath,true,"")
            backButton.visibility=View.GONE
            titleTextView.visibility=View.GONE
            startPlayLogic()
        }
        binding.tvComment.setText(item.commentnum.toString())
    }
}